﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Wpf.CommonTools.SystemExtension
{
    public class MyThread
    {
        public static void StopThread(Thread th)
        {
            if (th != null)
            {
                while (th.IsAlive == true)
                {
                    try
                    {
                        th.Abort();
                    }
                    catch { }
                    if (th.IsAlive == true)
                    {
                        Thread.Sleep(100);
                    }
                }
            }
        }
    }
}
